import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class Tail {
        
    public static void main(String[] args) throws IOException {
        
        Reader fileReader = new FileReader(args[0]);
        BufferedReader input = new BufferedReader(fileReader);
        String line = null;
        while (true) {
            if ((line = input.readLine()) != null) {
                if(line.contains("error") ||
                		line.contains("file_name") || 
                		line.contains("proc_flag") || 
                		line.contains("err_msg") ||
                		(line.contains("dirString") && 
                				(line.contains("_REQUEST") ||
                				 line.contains("_RESPONSE"))
                		)){

                        System.out.println(line);
                }
                continue;
            }
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException x) {
                Thread.currentThread().interrupt();
                break;
            }
        }
        input.close();
    }
}